home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / AmigaElm_v7.lha / c / EncryptMsg < prev    next >
AmigaDOS Script File  |  1995-05-27  |  2KB  |  54 lines

  1. .KEY cryptfile/A,cryptmode/A
  2. .BRA [
  3. .KET ]
  4.  
  5. ;
  6. ; EncryptMsg using PGP
  7. ;
  8. ; written by Peter Simons <simons@peti.GUN.de>
  9. ; modified by Ignatios Souvatzis <is@beverly.rhein.de> to be able to ask
  10. ; for passphrases etc.
  11. ; This version actually suceeds to open on Elm's screen.
  12. ; $VER: EncryptMsg <is@beverly.rhein.de> 1.5 (12-Apr-95)
  13. ;
  14.  
  15. FailAt 1
  16. Set pubscreen "`getactscreen`"
  17. SplitHeadBody <"[cryptfile]" "T:AmiElm-Header.${process}" "T:AmiElm-Body.${process}"
  18.  
  19. If "[cryptmode]" EQ "ENCRYPT"
  20.     RequestString RECIPIENTS "Please enter recipient(s) ID(s)..." 256
  21.     PGP -tea "T:AmiElm-Body.${process}" <>"CON:///100/PGP/AUTO/WAIT/CLOSE/SCREEN${pubscreen}" ${RECIPIENTS}
  22.     UnSet RECIPIENTS
  23. Else
  24. If "[cryptmode]" EQ "SIGN"
  25.     PGP -tsa "T:AmiElm-Body.${process}" <>"CON:///100/PGP/AUTO/WAIT/CLOSE/SCREEN${pubscreen}" +clearsig=on
  26. Else
  27. If "[cryptmode]" EQ "ENCRYPT+SIGN"
  28.     RequestString RECIPIENTS "Please enter recipient(s) ID(s)..." 256
  29.     PGP -tesa "T:AmiElm-Body.${process}" <>"CON:///100/PGP/AUTO/WAIT/CLOSE/SCREEN${pubscreen}" ${RECIPIENTS}
  30.     UnSet RECIPIENTS
  31. Else
  32.     Echo "elm: Encrypt mode *"[cryptmode]*" not supported by *"EncryptMsg*" script!"
  33.     Echo "elm: WARNING! Mail not modified, sending mail NOT encrypted ..."
  34.     Delete "T:AmiElm-Header.${process}" "T:AmiElm-Body.${process}" QUIET FORCE
  35.     Quit
  36. EndIf
  37. EndIf
  38. EndIf
  39.  
  40. ;
  41. ; now copy the encrypted message back, build new message from header and body
  42. ; and get rid of our temporary files
  43. ;
  44.  
  45. Echo "*N" >"t:AmiElm-Line.${process}" NOLINE
  46. Delete "[cryptfile]" QUIET FORCE
  47. Join "T:AmiElm-Header.${process}" "T:AmiElm-Line.${process}" "T:AmiElm-Body.${process}.asc" as "[cryptfile]"
  48. Delete "T:AmiElm-Body.${process}" "T:AmiElm-Header.${process}" "T:AmiElm-Body.${process}.asc" "T:AmiElm-Line.${process}" QUIET FORCE
  49. UnSet pubscreen
  50.  
  51. ;
  52. ; bye,bye
  53.